package com.example.shiyan2;

    import android.annotation.SuppressLint;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;

    import androidx.appcompat.app.AppCompatActivity;

    public class MainActivity extends AppCompatActivity {

        @SuppressLint("ResourceType")

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            Button button1 =findViewById(R.id.button1);
            button1.setOnClickListener(v -> {
                Intent intent = new Intent(MainActivity.this, Activity1.class);
                startActivity(intent);
            });
        }
        // Method to open Activity 1
        public void openActivity1(View view) {
            Intent intent;
            intent = new Intent(MainActivity.this, Activity1.class);
            startActivity(intent);
        }

        // Method to open Activity 2
        public void openActivity2(View view) {
            Intent intent = new Intent(this, Activity2.class);
            startActivity(intent);
        }

        // Method to open Activity 3
        public void openActivity3(View view) {
            Intent intent = new Intent(this, Activity3.class);
            startActivity(intent);
        }

        // Method to open Activity 4
        public void openActivity4(View view) {
            Intent intent = new Intent(this, Activity4.class);
            startActivity(intent);
        }

        // Method to open Activity 5
        public void openActivity5(View view) {
            Intent intent = new Intent(this, Activity5.class);
            startActivity(intent);
        }


    }